package com.dfdchem.imd.kaiwu.util;

import com.dfdchem.imd.kaiwu.R;

public class AlarmUtil {
    /*{text: '调试', id: 1},
    {text: '白色', id: 10},
    {text: '蓝色', id: 20},
    {text: '黄色', id: 30},
    {text: '橙色', id: 40},
    {text: '红色', id: 50},*/

    public static String getTextByAlarmLevel(int alarmLevel) {
        switch (alarmLevel) {
            case 1: return "调试";
            case 10: return "白色";
            case 20: return "蓝色";
            case 30: return "黄色";
            case 40: return "橙色";
            case 50: return "红色";
        }
        return "-";
    }

    private static int[] colors = {R.color.gray, R.color.white, R.color.blue, R.color.yellow, R.color.orangered, R.color.red};

    public static int getColorByAlarmLevel(int alarmLevel) {
        switch (alarmLevel) {
            case 1: return colors[0];
            case 10: return colors[1];
            case 20: return colors[2];
            case 30: return colors[3];
            case 40: return colors[4];
            case 50: return R.color.red;
        }
        return colors[0];
    }

    public static String getTextByExp(int exp) {
        switch (exp) {
            // 其他的条件暂不需要
            case 1: return "超出工艺控制参数";
            case 10: return "等于";
            case 11: return "不等于";
            case 12: return "小于";
            case 13: return "小于等于";
            case 14: return "大于";
            case 15: return "大于等于";
        }

        return "-";
    }
}
